package com.heima.media.listener;

import com.heima.media.task.ArticleDelayTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class ArticleDelayListener{

    @Autowired
    private ArticleDelayTask articleDelayTask;

    @PostConstruct // 启动时自动执行该任务 也就是当前对象初始化后就会执行这个方法
    public void handleMessage() throws Exception {
        articleDelayTask.handleMessage();
    }
}
